<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/26
  Time: 14:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>交接登记模态框</title>
</head>
<body>
            <div class= "modal-header">
                <button class="close" data-dismiss="modal">退出</button>
                <input type="button" onclick="handoverregistrationmodalmodalbtn()" value="确定" class="btn btn-default">
            </div>
            <div class="modal-body" >
                <div>
                    <strong><span style="color:deepskyblue">您正在做的业务是：生产管理--内部生产管理--生产登记</span></strong>
                </div>
                <br>
                <br>
                <br>
                <br>
                <br>
                <div class="input-group" align="center">
                    <span class="input-group-addon"  id="basic-addonhand">请输入本次工序合格数量</span>
                    <input type="text" class="form-control" id="handnum"  aria-describedby="basic-addonhand">
                </div>
                <div style="height: 300px">

                </div>
            </div>
            <script>
                function handoverregistrationmodalmodalbtn() {
                        var id='${param.id}'
                        var amount='${param.amount}'
                        var i=0;
                        if(Number(amount)<Number($("#handnum").val())){
                            alert("合格数量不能大于生产数量")
                            i++;
                        }

                        var rel=/^[0-9]*$/
                        if(!rel.test($("#handnum").val())){
                            alert("请输入正确的数量")
                            i++;
                        }
                        //成功修改
                        if(i==0){
                            $.post("updaterealamount.action",{"id":id,"amount":$("#handnum").val()},function (data) {
                                alert(data.msg)
                                //关闭模态框
                                $("#handoverregistrationmodal").modal("hide")
                                //刷新表格
                                alo()
                            },"json")
                        }
                }
            </script>
</body>
</html>
